package com.sct.meiye.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sct.meiye.entity.LimitKill;
import com.sct.meiye.entity.Result;
import com.sct.meiye.entity.ServiceItem;
import com.sct.meiye.service.LimitKillService;
import com.sct.meiye.service.ServiceItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/sct/api/meiye/limit_kill")
public class LimitKillController {

    @Autowired
    private LimitKillService limitKillService;

    @Autowired
    private ServiceItemService serviceItemService;

    @GetMapping("/getLimitKill")
    public Result<Object> getLimitKillList(){
        Map<String,Object> map=new HashMap<>();
        map.put("list",serviceItemService.list(new QueryWrapper<ServiceItem>().eq("is_limit_kill",1)));
        map.put("limitKill",limitKillService.getOne(new QueryWrapper<LimitKill>().like("limit_time","")));
        return new Result<>(HttpStatus.OK.value(),"success",map);
    }


}
